import  * as actionType from '../actions/actionType';

const initState={
    pageTitle: '首页',
    isSubpage:false
};
export default (state=initState,action)=>{
    switch (action.type) {
        case actionType.CHANGE_PAGE_TITLE:
            if(Object.prototype.toString.call(action.type)!=="[object String]"){
                return state;
            }
            return{
                ...state,
              pageTitle:action.title
            }
        case actionType.IS_SUBPAGE:
            return{
                ...state,
                isSubpage:action.isSubpage
            }
        default:
            return state;
    }
}